<?php
/**
 * Interview Block
 */
use Hive\Authorizations;
use Fox\Authorization;
use Hive\Contact\Wish\Mood;
use Hive\Contact\Wish\Company\Size;
use Fox\Html\DropList\Token;
use Fox\Generator;
use Fox\Html\Input;
use Fox\Html\DropList;
use Fox\Html\TextArea;

$userList = Xview::instance()->application()->getUsers();
$block = new Fox\Html\Block('desire');
$block->add(new DropList('mood',true,false,true))
		->source(Generator::url('contacts','wishes','mood_droplist'))
		->options(Mood::loadActives(),'mood',Generator::call('label'),true,true);
$block->add(new TextArea('joblist'))->colspan(2);
$block->add(new Input('targeted_salary'));
$block->add(new Input('targeted_bonus'),2,'targeted_salary');
$block->add(new DropList('company_size_type',true,false,false))
		->source(Generator::url('contacts','wishes','company_droplist'))
		->options(Size::loadActives(),'company_size_type',Generator::call('label'),true,true);
// Short cut to add a Company Size
if(Authorization\Manager::check(Authorizations::CONTACT_WISHES_ADM_W)) {
	$block->item('mood')->add(new \Fox\Html\Action\Anchor('addMood',
			Fox\Behaviors::action(Generator::url('contacts','wishes','mood_modify',array('area' => 'contact')),true)
			))->label('<span class="action-links">[+]</span>');
	$block->item('company_size_type')->add(new \Fox\Html\Action\Anchor('addCpSize',
			Fox\Behaviors::action(Generator::url('contacts','wishes','company_modify',array('area' => 'contact')),true)
			))->label('<span class="action-links">[+]</span>');
}
// Localization
$block->add(new Token('localization'))
		->colspan(2)
		->source(Generator::url('localization','autocomplete'))
		->formater("\\Fox\\Common\\Localization::parse");
if(isset($params['data'])) {
	$block->initialize($params['data']);
}
return $block;